Location in SDK: SDK\Samples\Classic ASP\Discount Sitelet
The primary goal of the Discount Sitelet is to demonstrate how to create and apply discounts to items added to a shopping cart using the Campaign Manager module in Commerce Server Business Desk and the Basket pipeline. Using this sitelet, you can examine a demonstration of discounts based on hard coded catalog data, and understand how the discount pipeline component works in the Order Processing pipeline (OPP). The Discount Sitelet shows you how to:
The Discount Sitelet consists of a package file, which you unpack using Commerce Server Site Packager. The source code for the sitelet is included in this package. Using the Discount Sitelet, you can implement discounts on a Commerce Server-based Web site. No modification to the code is required to deploy the sitelet to a server running Commerce Server 2002.
Discounts in the sitelet are determined by what type of account the user has. Users that log in as Premier Users get 10 percent off all items in their basket. Premier Users also receive an additional 40 percent off Black Diamond Quicksilver II when they purchase Gibraltar. Users that log in as Standard Users get 50 percent off an item when they purchase three items.
Best coding practices are maintained in this sample, and the code represents the prescribed method of using the object model.
ASP-Based Discount Sitelet Code Notes
Installing the ASP-Based Discount Sitelet
The discounts, users, and catalog are hard-coded in the Discount Sitelet, meaning that this data is stored in the appropriate SQL Server site database tables during the site installation process.
This sitelet demonstrates multilingual functionality. The following languages are supported: English, French, German, and Japanese. Language character sets are set in the Main routine of several ASP pages using code such as the following:
Sub Main()
Set g_ojbMsgMgr = Application ("MSCSMessageManager")
Response.CharSet = "iso-8859-1"
End Sub
Notes
You unpack the Discount Sitelet using Commerce Server Site Packager. The package file is located in the following directory:
<drive>:\Program Files\Microsoft Commerce Server 2002\SDK\Samples\Classic ASP\Discount Sitelet\SDK-DISCOUNT-SITELET.PUP
Unpacking the ASP-based Discount Sitelet using the Custom unpack option and creating independent databases for each of the site resources is not recommended.
Use the following procedures to install the Discount Sitelet on one computer using the Quick mode in Site Packager.
To unpack the Discount Sitelet
To add a blank Business Desk to the Discount Sitelet
To import the Adventure Works Catalog
Adding a Business Desk to the Discount Sitelet is optional.
| Use this | To do this |
| Machine Name of IIS Server | Type the computer name for the IIS server. |
| IIS Web site | Select the Default Web Site from the drop-down list. |
| IIS Virtual Directory | Type discountsiteletbizdesk where blankbizdesk currently appears. |
For more information about importing the Adventure Works Catalog, see the topic Importing an XML Catalog File in the Commerce Server 2002 Help file.
Using Internet Explorer, in the Address box, type HTTP: //<ComputerName>/DiscountSitelet, and then press Enter.